from elasticsearch import Elasticsearch
from args import *
from log import *
es = Elasticsearch(hosts=ELASTIC_ADDRESS, basic_auth=(ELASTIC_USERNAME, ELASTIC_PASSWORD), timeout=1000)
index = INDEX_NAME
if es.indices.exists(index=index):
    temp = es.indices.delete(index=index, timeout="100s")
    logging.info(f'删除{index} 情况: {temp}')
    print(temp)
else:
    print("该索引不存在")